﻿using System;

namespace ZhangBY.Config
{
    /// <summary>
    /// 网站基本设置描述类, 加[Serializable]标记为可序列化
    /// </summary>
    [Serializable]
    public class GeneralConfigInfo : IConfigInfo
    {
        #region 私有字段
        private string m_weburl = "index.aspx"; //网站url地址
        private string m_webtitle = "中国茶叶批发"; //网站名称
        
        private string m_icp = ""; //网站备案信息
        private int m_closed = 0; //网站关闭
        private string m_closedreason = ""; //网站关闭提示信息     
        private string m_passwordkey = "1234567890"; //用户密码Key
        private int m_maxupimgspace = 5;//用户图片空间最大容量
        private int m_regstatus = 1; //是否允许新用户注册
        private int m_regadvance = 0; //注册时候是否显示高级选项
        private int m_welcomemsg = 1; //发送欢迎短消息
        private int m_rules = 1; //是否显示注册许可协议
        private string m_rulestxt = ""; //许可协议内容
        private int m_onlinetimeout = 10; //多久无动作视为离线
        private int m_deletingexpireduserfrequency = 5;//删除过期用户频率
        private string m_cookiedomain = "";//身份验证Cookie域
        private int m_cookietimeout = 10;//COOKIE有效时间
        private bool m_base64status = true;//是否应用BASE64加密
        private string m_waterText = "http://www.zhangby.com";//图片水印文字
        private int m_countPages = 4;//表格分页行数
        private int m_pages = 9;//要显示的分页页码
        private char m_lackKeyValue = (char)97;//'';//用于补充加密位数缺省值

        private int m_comment_audit = 0;//留言审核（0不审核 1新留言审核 2更新审核）
        private int m_companynews_audit = 0;//公司新闻审核（0不审核 1新留言审核 2更新审核）

        #endregion

        #region 属性 

        /// <summary>
        /// 网站名称
        /// </summary>
        public string Webtitle
        {
            get { return m_webtitle; }
            set { m_webtitle = value; }
        }

        /// <summary>
        /// 网站网站url地址
        /// </summary>
        public string Weburl
        {
            get { return m_weburl; }
            set { m_weburl = value; }
        }
        
        /// <summary>
        ///用户图片空间最大容量
        /// </summary>
        public int MaxUpImgSpace
        {
            get { return m_maxupimgspace; }
            set { m_maxupimgspace = value; }
        }

        /// <summary>
        /// 网站备案信息
        /// </summary>
        public string Icp
        {
            get { return m_icp; }
            set { m_icp = value; }
        }

        /// <summary>
        /// 网站关闭
        /// </summary>
        public int Closed
        {
            get { return m_closed; }
            set { m_closed = value; }
        }

        /// <summary>
        /// 网站关闭提示信息
        /// </summary>
        public string Closedreason
        {
            get { return m_closedreason; }
            set { m_closedreason = value; }
        }       

        /// <summary>
        /// 用户密码Key
        /// </summary>
        public string Passwordkey
        {
            get { return m_passwordkey; }
            set { m_passwordkey = value; }
        }

        /// <summary>
        /// 是否允许新用户注册
        /// </summary>
        public int Regstatus
        {
            get { return m_regstatus; }
            set { m_regstatus = value; }
        }

        /// <summary>
        /// 注册时候是否显示高级选项
        /// </summary>
        public int Regadvance
        {
            get { return m_regadvance; }
            set { m_regadvance = value; }
        }

        /// <summary>
        /// 是否显示欢迎消息
        /// </summary>
        public int WelcomeMsg
        {
            get { return m_welcomemsg; }
            set { m_welcomemsg = value; }
        }

        /// <summary>
        /// 是否显示注册许可协议
        /// </summary>
        public int Rules
        {
            get { return m_rules; }
            set { m_rules = value; }
        }

        /// <summary>
        /// 注册许可协议内容
        /// </summary>
        public string RulesTxt
        {
            get { return m_rulestxt; }
            set { m_rulestxt = value; }
        }

        /// <summary>
        /// 超时时间
        /// </summary>
        public int Onlinetimeout
        {
            get { return m_onlinetimeout; }
            set { m_onlinetimeout = value; }
        }

        /// <summary>
        /// 删除过期用户频率
        /// </summary>
        public int Deletingexpireduserfrequency
        {
            get
            {
                if (m_deletingexpireduserfrequency < 1)
                    m_deletingexpireduserfrequency = 5;
                return m_deletingexpireduserfrequency;
            }
        }

        /// <summary>
        /// 身份验证Cookie域
        /// </summary>
        public string CookieDomain
        {
            get { return m_cookiedomain; }
            set { m_cookiedomain = value; }
        }

        /// <summary>
        /// Cookie有效时间
        /// </summary>
        public int CookieTimeout
        {
            get { return m_cookietimeout; }
            set { m_cookietimeout = value; }
        }

        /// <summary>
        /// 是否启用BASE64加密
        /// </summary>
        public bool Base64status
        {
            get { return m_base64status; }
            set { m_base64status = value; }
        }

        /// <summary>
        /// 水印文字
        /// </summary>
        public string WaterText
        {
            get { return m_waterText; }
            set { m_waterText = value; }
        }

        /// <summary>
        /// 列表分页大小（分页行数）
        /// </summary>
        public int CountPages
        {
            get { return m_countPages; }
            set { m_countPages = value; }
        }

        /// <summary>
        /// 要显示的分页页码
        /// </summary>
        public int Pages
        {
            get { return m_pages; }
            set { m_pages = value; }
        }

        /// <summary>
        /// 用于补充加密位数缺省值
        /// </summary>
        public char LackKeyValue
        {
            get { return m_lackKeyValue; }
        }


        #endregion

        /// <summary>
        /// 留言审核（0不审核 1新留言审核 2更新审核）
        /// </summary>
        public int CommentAudit
        {
            get { return m_comment_audit; }
            set { m_comment_audit = value; }
        }
        /// <summary>
        /// 公司新闻审核（0不审核 1新留言审核 2更新审核）
        /// </summary>
        public int CommentNewsAudit
        {
            get { return m_companynews_audit; }
            set { m_companynews_audit = value; }
        }

    }
        
}
     